﻿using DapperExtensions.Mapper;

namespace ZilLion.Service.ZilLionOss.Domain.Entitys
{
    /// <summary>
    ///     岗位页面授权
    /// </summary>
    public class OssRoleRouteEntity
    {
        public long Roleid { get; set; }
        public string RoutePath { get; set; }
    }

    /// <summary>
    ///     岗位与员工映射关系
    /// </summary>
    public class OssUserRouteEntity
    {
        public long UserId { get; set; }
        public string RoutePath { get; set; }
    }

    public class OssRolePageEntityMapper : ClassMapper<OssRoleRouteEntity>
    {
        public OssRolePageEntityMapper()
        {
            Table("oss_role_page");
            Map(f => f.Roleid).Column("roleid").Key(KeyType.Assigned);
            Map(f => f.RoutePath).Column("pageroute").Key(KeyType.Assigned);
        }
    }

    public class OssUserPageEntityMapper : ClassMapper<OssUserRouteEntity>
    {
        public OssUserPageEntityMapper()
        {
            Map(f => f.UserId).Column("userid");
            Map(f => f.RoutePath).Column("pageroute");
        }
    }
}